#ifndef __AUDIODIRECTSOUND_H__
#define __AUDIODIRECTSOUND_H__

#pragma once
#include "audio/IAudio.h"
//#include "\dx\"
#include "dsound.h"


namespace directx {

/**
 * \ingroup CoreEngine
 *
 * The AudioDirectSound class.
 * DirectSound implementation of the IAudio interface.
 *
 * \version 1.0
 * first version
 *
 * \date 03-28-2007
 *
 * \author altjohann
 *
 */
class AudioDirectSound :
	public audio::IAudio//, public Singleton<AudioDirectSound>
{
public:
	AudioDirectSound(void);
	virtual ~AudioDirectSound(void);

	virtual bool init();	
	virtual void destroy();	
	virtual void update();

	virtual audio::ISoundEffect* createISoundEffect(const std::string &, int);
	virtual audio::IStreamingSound* createIStreamingSound(const std::string &); 

protected:
	
	LPDIRECTSOUND8 lpds;
	LPDIRECTSOUND3DLISTENER lpListener;

	
	HRESULT getListener(LPDIRECTSOUND8, LPDIRECTSOUND3DLISTENER8*);
	//HRESULT loadWF( LPWSTR strFileName, WAVEFORMATEX* pwfx, DWORD dwFlags );
	HRESULT CreateBasicBuffer(LPDIRECTSOUND8, LPDIRECTSOUNDBUFFER8*);
	bool openSNDFile(const char*);

	/*
	CSoundManager* g_pSoundManager;
	LPDIRECTSOUND3DLISTENER g_pDSListener;
	DS3DLISTENER g_dsListenerParams;
	*/
};


}
#endif // __AUDIODIRECTSOUND_H__

